/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.util.ArrayList;

/**
 *
 * @author user
 */
public class Users extends ArrayList<User> {

    public User find(int userId) {
        User user;

        for (int i = 0; i < this.size(); ++i) {
            user = this.get(i);
            if (user.id == userId) {
                return user;
            }
        }

        return null;
    }

    public User find(String username) {
        User user;

        for (int i = 0; i < this.size(); ++i) {
            user = this.get(i);
            if (user.username.equals(username)) {
                return user;
            }
        }

        return null;
    }
}
